#Human body infrared sensor & LED

import time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO_SR = 18
GPIO_LED = 23
GPIO.setup(GPIO_SR,GPIO.IN)
GPIO.setup(GPIO_LED,GPIO.OUT)

while True:
    inValue = GPIO.input(GPIO_SR)
    if inValue != 0:
        print("Light ON")
        GPIO.output(GPIO_LED,True)
    else:
        GPIO.output(GPIO_LED,False)
    time.sleep(0.01)

GPIO.cleanup()

